.class final Lorg/jboss/netty/handler/codec/spdy/SpdySession;
.super Ljava/lang/Object;
.source "SpdySession.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;
    }
.end annotation


# instance fields
.field private final activeStreams:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map",
            "<",
            "Ljava/lang/Integer;",
            "Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method constructor <init>()V
    .locals 1

    .prologue
    .line 26
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 23
    new-instance v0, Ljava/util/concurrent/ConcurrentHashMap;

    invoke-direct {v0}, Ljava/util/concurrent/ConcurrentHashMap;-><init>()V

    iput-object v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->activeStreams:Ljava/util/Map;

    .line 27
    return-void
.end method


# virtual methods
.method public acceptStream(IZZ)V
    .locals 3
    .parameter "streamID"
    .parameter "remoteSideClosed"
    .parameter "localSideClosed"

    .prologue
    .line 42
    if-eqz p2, :cond_0

    if-nez p3, :cond_1

    .line 43
    :cond_0
    iget-object v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->activeStreams:Ljava/util/Map;

    new-instance v1, Ljava/lang/Integer;

    invoke-direct {v1, p1}, Ljava/lang/Integer;-><init>(I)V

    new-instance v2, Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;

    invoke-direct {v2, p2, p3}, Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;-><init>(ZZ)V

    invoke-interface {v0, v1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 46
    :cond_1
    return-void
.end method

.method public closeLocalSide(I)V
    .locals 3
    .parameter "streamID"

    .prologue
    .line 74
    new-instance v0, Ljava/lang/Integer;

    invoke-direct {v0, p1}, Ljava/lang/Integer;-><init>(I)V

    .line 75
    .local v0, StreamID:Ljava/lang/Integer;
    iget-object v2, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->activeStreams:Ljava/util/Map;

    invoke-interface {v2, v0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;

    .line 76
    .local v1, state:Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;
    if-eqz v1, :cond_0

    .line 77
    invoke-virtual {v1}, Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;->closeLocalSide()V

    .line 78
    invoke-virtual {v1}, Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;->isRemoteSideClosed()Z

    move-result v2

    if-eqz v2, :cond_0

    .line 79
    iget-object v2, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->activeStreams:Ljava/util/Map;

    invoke-interface {v2, v0}, Ljava/util/Map;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    .line 82
    :cond_0
    return-void
.end method

.method public closeRemoteSide(I)V
    .locals 3
    .parameter "streamID"

    .prologue
    .line 58
    new-instance v0, Ljava/lang/Integer;

    invoke-direct {v0, p1}, Ljava/lang/Integer;-><init>(I)V

    .line 59
    .local v0, StreamID:Ljava/lang/Integer;
    iget-object v2, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->activeStreams:Ljava/util/Map;

    invoke-interface {v2, v0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;

    .line 60
    .local v1, state:Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;
    if-eqz v1, :cond_0

    .line 61
    invoke-virtual {v1}, Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;->closeRemoteSide()V

    .line 62
    invoke-virtual {v1}, Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;->isLocalSideClosed()Z

    move-result v2

    if-eqz v2, :cond_0

    .line 63
    iget-object v2, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->activeStreams:Ljava/util/Map;

    invoke-interface {v2, v0}, Ljava/util/Map;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    .line 66
    :cond_0
    return-void
.end method

.method public hasReceivedReply(I)Z
    .locals 3
    .parameter "streamID"

    .prologue
    .line 85
    iget-object v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->activeStreams:Ljava/util/Map;

    new-instance v2, Ljava/lang/Integer;

    invoke-direct {v2, p1}, Ljava/lang/Integer;-><init>(I)V

    invoke-interface {v1, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;

    .line 86
    .local v0, state:Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;
    if-eqz v0, :cond_0

    invoke-virtual {v0}, Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;->hasReceivedReply()Z

    move-result v1

    if-eqz v1, :cond_0

    const/4 v1, 0x1

    :goto_0
    return v1

    :cond_0
    const/4 v1, 0x0

    goto :goto_0
.end method

.method public isActiveStream(I)Z
    .locals 2
    .parameter "streamID"

    .prologue
    .line 38
    iget-object v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->activeStreams:Ljava/util/Map;

    new-instance v1, Ljava/lang/Integer;

    invoke-direct {v1, p1}, Ljava/lang/Integer;-><init>(I)V

    invoke-interface {v0, v1}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v0

    return v0
.end method

.method public isLocalSideClosed(I)Z
    .locals 3
    .parameter "streamID"

    .prologue
    .line 69
    iget-object v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->activeStreams:Ljava/util/Map;

    new-instance v2, Ljava/lang/Integer;

    invoke-direct {v2, p1}, Ljava/lang/Integer;-><init>(I)V

    invoke-interface {v1, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;

    .line 70
    .local v0, state:Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;
    if-eqz v0, :cond_0

    invoke-virtual {v0}, Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;->isLocalSideClosed()Z

    move-result v1

    if-eqz v1, :cond_1

    :cond_0
    const/4 v1, 0x1

    :goto_0
    return v1

    :cond_1
    const/4 v1, 0x0

    goto :goto_0
.end method

.method public isRemoteSideClosed(I)Z
    .locals 3
    .parameter "streamID"

    .prologue
    .line 53
    iget-object v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->activeStreams:Ljava/util/Map;

    new-instance v2, Ljava/lang/Integer;

    invoke-direct {v2, p1}, Ljava/lang/Integer;-><init>(I)V

    invoke-interface {v1, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;

    .line 54
    .local v0, state:Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;
    if-eqz v0, :cond_0

    invoke-virtual {v0}, Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;->isRemoteSideClosed()Z

    move-result v1

    if-eqz v1, :cond_1

    :cond_0
    const/4 v1, 0x1

    :goto_0
    return v1

    :cond_1
    const/4 v1, 0x0

    goto :goto_0
.end method

.method public noActiveStreams()Z
    .locals 1

    .prologue
    .line 34
    iget-object v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->activeStreams:Ljava/util/Map;

    invoke-interface {v0}, Ljava/util/Map;->isEmpty()Z

    move-result v0

    return v0
.end method

.method public numActiveStreams()I
    .locals 1

    .prologue
    .line 30
    iget-object v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->activeStreams:Ljava/util/Map;

    invoke-interface {v0}, Ljava/util/Map;->size()I

    move-result v0

    return v0
.end method

.method public receivedReply(I)V
    .locals 3
    .parameter "streamID"

    .prologue
    .line 90
    iget-object v1, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->activeStreams:Ljava/util/Map;

    new-instance v2, Ljava/lang/Integer;

    invoke-direct {v2, p1}, Ljava/lang/Integer;-><init>(I)V

    invoke-interface {v1, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;

    .line 91
    .local v0, state:Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;
    if-eqz v0, :cond_0

    .line 92
    invoke-virtual {v0}, Lorg/jboss/netty/handler/codec/spdy/SpdySession$StreamState;->receivedReply()V

    .line 94
    :cond_0
    return-void
.end method

.method public removeStream(I)V
    .locals 2
    .parameter "streamID"

    .prologue
    .line 49
    iget-object v0, p0, Lorg/jboss/netty/handler/codec/spdy/SpdySession;->activeStreams:Ljava/util/Map;

    new-instance v1, Ljava/lang/Integer;

    invoke-direct {v1, p1}, Ljava/lang/Integer;-><init>(I)V

    invoke-interface {v0, v1}, Ljava/util/Map;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    .line 50
    return-void
.end method
